---------------------------------------------------------------------------------------------------------------
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.4.log
  log type:  text
 opened on:  12 May 2025, 18:21:16

. use "C:\Users\sbstjp\OneDrive - Cardiff University\voter_panel.dta" // Democracy Fund Voter Study Group. VIEW
> S OF THE ELECTORATE RESEARCH SURVEY. Washington, D.C. https://www.voterstudygroup.org/.  Date accessed: March
>  09, 2025.

. 
. // Create liberal democracy scale
. *Rename so variable names don't get too long
. rename govpower_censormedia_2019Nov censormedia

. rename govpower_criticizepres_2019Nov critpres

. rename govpower_suspendcongress_2019Nov suspendcongress

. rename govpower_suspendlaws_2019Nov suspendlaws

. rename govpower_suspendrights_2019Nov suspendrights

. 
. * Delete "don't know" responses 
. foreach var in censormedia critpres suspendcongress suspendlaws suspendrights {
  2.     replace `var' = . if `var' >4
  3. }
(778 real changes made, 778 to missing)
(569 real changes made, 569 to missing)
(764 real changes made, 764 to missing)
(798 real changes made, 798 to missing)
(780 real changes made, 780 to missing)

. 
. *Reverse variable so liberal values coded high
. foreach var in censormedia critpres {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' + 1 - `var'
  5. }
(7,395 missing values generated)
(7,186 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in rcensormedia rcritpres suspendcongress suspendlaws suspendrights {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rcensormedia |      5,122    2.982819    1.028446          1          4
(7,395 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
   rcritpres |      5,331     3.53686    .8007392          1          4
(7,186 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
suspendcon~s |      5,136    3.332555    1.037936          1          4
(7,381 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
 suspendlaws |      5,102    3.331047     .969427          1          4
(7,415 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
suspendrig~s |      5,120    3.375195    .9056108          1          4
(7,397 missing values generated)

. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values and means a 0-1 standardization scale isn't feasible as missing values would overlap with the scale
. foreach var in srcensormedia srcritpres ssuspendcongress ssuspendlaws ssuspendrights {
  2.     replace `var' = 0 if missing(`var')
  3. }
(7,395 real changes made)
(7,186 real changes made)
(7,381 real changes made)
(7,415 real changes made)
(7,397 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreLD = 0

. gen count_nonzeroLD = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in srcensormedia srcritpres ssuspendcongress ssuspendlaws ssuspendrights {
  2.     replace total_scoreLD = total_scoreLD + `var'
  3.     replace count_nonzeroLD = count_nonzeroLD + (`var' != 0)
  4. }
(5,122 real changes made)
(5,122 real changes made)
(5,331 real changes made)
(5,331 real changes made)
(5,136 real changes made)
(5,136 real changes made)
(5,102 real changes made)
(5,102 real changes made)
(5,120 real changes made)
(5,120 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen LibDemScale = .
(12,517 missing values generated)

. replace LibDemScale = total_scoreLD / count_nonzeroLD if count_nonzeroLD > 0
(5,541 real changes made)

. 
. // Create social justice scale
. *Delete missing
. replace ft_blm_2020Sep=. if ft_blm_2020Sep>100
(195 real changes made, 195 to missing)

. replace reparations_2020Sep=. if reparations_2020Sep>2
(1,207 real changes made, 1,207 to missing)

. replace defundpolice_2020Sep=. if defundpolice_2020Sep>2 
(906 real changes made, 906 to missing)

. replace police_threat_2020Sep=. if police_threat_2020Sep>2
(3 real changes made, 3 to missing)

. replace usa_founders_2020Sep=. if usa_founders_2020Sep>2
(1,913 real changes made, 1,913 to missing)

. replace internetharass_dem_2020Sep=. if internetharass_dem_2020Sep==9
(2,996 real changes made, 2,996 to missing)

. 
. *Reverse coding so social justice values are coded high
. foreach var in reparations_2020Sep defundpolice_2020Sep usa_founders_2020Sep {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' - `var'
  5. }
(7,824 missing values generated)
(7,523 missing values generated)
(8,530 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in ft_blm_2020Sep rreparations_2020Sep rdefundpolice_2020Sep rusa_founders_2020Sep police_threat_
> 2020Sep internetharass_dem_2020Sep {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
ft_blm_202~p |      5,705    50.44943    38.23238          0        100
(6,812 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rreparatio~p |      4,693    .2959727    .4565274          0          1
(7,824 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rdefundpol~p |      4,994    .2573088    .4371947          0          1
(7,523 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rusa_found~p |      3,987    .1662904    .3723879          0          1
(8,530 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
police_thr~p |      5,897     1.55825    .4966375          1          2
(6,620 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
i~em_2020Sep |      2,904    1.211088    .6539851          1          4
(9,613 missing values generated)

. 
. *At this stage, the scale has a Cronbach's alpha of 0.83
. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values
. foreach var in sft_blm_2020Sep srreparations_2020Sep srdefundpolice_2020Sep srusa_founders_2020Sep spolice_th
> reat_2020Sep sinternetharass_dem_2020Sep {
  2.     replace `var' = 0 if missing(`var')
  3. }
(6,812 real changes made)
(7,824 real changes made)
(7,523 real changes made)
(8,530 real changes made)
(6,620 real changes made)
(9,613 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreSJV = 0

. gen count_nonzeroSJV = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in sft_blm_2020Sep srreparations_2020Sep srdefundpolice_2020Sep srusa_founders_2020Sep spolice_th
> reat_2020Sep sinternetharass_dem_2020Sep {
  2.     replace total_scoreSJV = total_scoreSJV + `var'
  3.     replace count_nonzeroSJV = count_nonzeroSJV + (`var' != 0)
  4. }
(5,705 real changes made)
(5,705 real changes made)
(4,693 real changes made)
(4,693 real changes made)
(4,994 real changes made)
(4,994 real changes made)
(3,987 real changes made)
(3,987 real changes made)
(5,897 real changes made)
(5,897 real changes made)
(2,904 real changes made)
(2,904 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen socJusValues = .
(12,517 missing values generated)

. replace socJusValues = total_scoreSJV / count_nonzeroSJV if count_nonzeroSJV > 0
(5,900 real changes made)

. 
. // Liberalism scale
. *Delete missing values
. replace immi_contribution_2020Nov=. if immi_contribution_2020Nov==4 
(420 real changes made, 420 to missing)

. replace immi_muslim_2020Nov=. if immi_muslim_2020Nov==5 
(761 real changes made, 761 to missing)

. replace view_abortlegal_2020Nov=. if view_abortlegal_2020Nov==4 
(300 real changes made, 300 to missing)

. replace view_gaymar_2020Nov=. if view_gaymar_2020Nov==3 
(598 real changes made, 598 to missing)

. 
. 
. *Reverse coding so liberal values are coded high
. foreach var in immi_contribution_2020Nov view_abortlegal_2020Nov view_gaymar_2020Nov rm1_enriched_2020Nov {
  2.     qui sum `var'
  3.     local max_value = r(max)
  4.     gen r`var' = `max_value' + 1 - `var'
  5. }
(7,994 missing values generated)
(7,874 missing values generated)
(8,172 missing values generated)
(7,574 missing values generated)

. 
. *Standardize items in the scale from 1-2 - this avoids 0, for reasons outlined in next step
. foreach var in rrm1_enriched_2020Nov rview_gaymar_2020Nov rview_abortlegal_2020Nov rimmi_contribution_2020Nov
>  sexism_complain_2020Nov sexism_equality_2020Nov immi_muslim_2020Nov {
  2.     summarize `var'
  3.     gen s`var' = 1 + (`var' - r(min)) / (r(max) - r(min))
  4. }

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rrm1_enric~v |      4,943    2.988873    .8324154          1          4
(7,574 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rview_gaym~v |      4,345    1.699194    .4586611          1          2
(8,172 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rview_abor~v |      4,643    2.244454    .6725274          1          3
(7,874 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
rimmi_cont~v |      4,523    2.203184    .9172139          1          3
(7,994 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
sexism_com~v |      4,943     3.01841    .9713963          1          4
(7,574 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
sexism_equ~v |      4,943    3.003237    1.043368          1          4
(7,574 missing values generated)

    Variable |        Obs        Mean    Std. dev.       Min        Max
-------------+---------------------------------------------------------
immi_musli~v |      4,182    2.849354     1.16485          1          4
(8,335 missing values generated)

. 
. 
. * Replace missing values with 0 for the specified variables - this is necessary as Stata doesn't add up missi
> ng values
. foreach var in srrm1_enriched_2020Nov srview_gaymar_2020Nov srview_abortlegal_2020Nov srimmi_contribution_202
> 0Nov ssexism_complain_2020Nov ssexism_equality_2020Nov simmi_muslim_2020Nov {
  2.     replace `var' = 0 if missing(`var')
  3. }
(7,574 real changes made)
(8,172 real changes made)
(7,874 real changes made)
(7,994 real changes made)
(7,574 real changes made)
(7,574 real changes made)
(8,335 real changes made)

. 
. * Initialize the total score and the count of non-zero responses
. gen total_scoreAL = 0

. gen count_nonzeroAL = 0

. 
. * Add each variable to the total scale score and count it if non-zero
. foreach var in srrm1_enriched_2020Nov srview_gaymar_2020Nov srview_abortlegal_2020Nov srimmi_contribution_202
> 0Nov ssexism_complain_2020Nov ssexism_equality_2020Nov simmi_muslim_2020Nov {
  2.     replace total_scoreAL = total_scoreAL + `var'
  3.     replace count_nonzeroAL = count_nonzeroAL + (`var' != 0)
  4. }
(4,943 real changes made)
(4,943 real changes made)
(4,345 real changes made)
(4,345 real changes made)
(4,643 real changes made)
(4,643 real changes made)
(4,523 real changes made)
(4,523 real changes made)
(4,943 real changes made)
(4,943 real changes made)
(4,943 real changes made)
(4,943 real changes made)
(4,182 real changes made)
(4,182 real changes made)

. 
. * Calculate the average score, avoiding division by zero
. gen libValues = .
(12,517 missing values generated)

. replace libValues = total_scoreAL / count_nonzeroAL if count_nonzeroAL > 0
(4,943 real changes made)

. 
. // Demographics
. *Delete missing values, generate age variable and rename
. replace faminc_2020Sep=. if faminc_2020Sep>20 
(772 real changes made, 772 to missing)

. gen age = 2020 - birthyr_2020Sep 
(6,617 missing values generated)

. rename gender_2020Sep FemaleGender 

. replace ideo5_2020Sep=. if ideo5_2020Sep==6 
(370 real changes made, 370 to missing)

. 
. *Generate dummy variables
. gen Graduate=.
(12,517 missing values generated)

. replace Graduate=1 if inlist(educ_2020Sep, 5, 6) 
(2,058 real changes made)

. replace Graduate=0 if inrange(educ_2020Sep, 1, 4)
(3,842 real changes made)

. 
. gen BIPOC=.
(12,517 missing values generated)

. replace BIPOC=0 if race_2020Sep==1
(4,059 real changes made)

. replace BIPOC = 1 if inrange(race_2020Sep, 2, 8) 
(1,841 real changes made)

. 
. // Standardize variables
. egen Age = std(age)
(6,617 missing values generated)

. egen Income = std(faminc_2020Sep)
(7,389 missing values generated)

. egen SocJusValues = std(socJusValues)
(6,617 missing values generated)

. egen LibValues = std(libValues)
(7,574 missing values generated)

. 
. // Regressions
. regress LibDemScale SocJusValues [pweight=weight_allpanel_2020Nov], robust
(sum of wgt is 3,233.7104)

Linear regression                               Number of obs     =      3,256
                                                F(1, 3254)        =      73.28
                                                Prob > F          =     0.0000
                                                R-squared         =     0.0693
                                                Root MSE          =     .21643

------------------------------------------------------------------------------
             |               Robust
 LibDemScale | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
SocJusValues |   .0623266   .0072806     8.56   0.000     .0480516    .0766016
       _cons |   1.773406   .0066089   268.33   0.000     1.760448    1.786364
------------------------------------------------------------------------------

. eststo
(est1 stored)

. regress LibDemScale Age BIPOC FemaleGender Graduate Income SocJusValues [pweight=weight_allpanel_2020Nov], ro
> bust 
(sum of wgt is 2,836.2758)

Linear regression                               Number of obs     =      2,853
                                                F(6, 2846)        =      29.91
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1254
                                                Root MSE          =     .21084

------------------------------------------------------------------------------
             |               Robust
 LibDemScale | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |   .0058227   .0085134     0.68   0.494    -.0108704    .0225158
       BIPOC |  -.0338078   .0153144    -2.21   0.027    -.0638362   -.0037794
FemaleGender |  -.0693536   .0143781    -4.82   0.000    -.0975461    -.041161
    Graduate |   .0551822   .0126816     4.35   0.000     .0303161    .0800482
      Income |   .0217293   .0073356     2.96   0.003     .0073457    .0361128
SocJusValues |   .0743745   .0081309     9.15   0.000     .0584315    .0903175
       _cons |   1.869023   .0259279    72.09   0.000     1.818183    1.919862
------------------------------------------------------------------------------

. eststo
(est2 stored)

. regress LibDemScale LibValues [pweight=weight_allpanel_2020Nov], robust
(sum of wgt is 3,233.7104)

Linear regression                               Number of obs     =      3,256
                                                F(1, 3254)        =     253.77
                                                Prob > F          =     0.0000
                                                R-squared         =     0.1701
                                                Root MSE          =     .20437

------------------------------------------------------------------------------
             |               Robust
 LibDemScale | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
   LibValues |   .0906901    .005693    15.93   0.000     .0795279    .1018522
       _cons |   1.775215   .0055927   317.42   0.000     1.764249     1.78618
------------------------------------------------------------------------------

. eststo
(est3 stored)

. regress LibDemScale Age BIPOC FemaleGender Graduate Income LibValues [pweight=weight_allpanel_2020Nov], robus
> t 
(sum of wgt is 2,836.2758)

Linear regression                               Number of obs     =      2,853
                                                F(6, 2846)        =      67.54
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2310
                                                Root MSE          =      .1977

------------------------------------------------------------------------------
             |               Robust
 LibDemScale | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |   .0003072   .0079298     0.04   0.969    -.0152416    .0158559
       BIPOC |  -.0181311   .0136957    -1.32   0.186    -.0449856    .0087235
FemaleGender |   -.089945   .0126019    -7.14   0.000    -.1146549   -.0652352
    Graduate |    .035412   .0114646     3.09   0.002     .0129322    .0578919
      Income |    .009993   .0066921     1.49   0.135    -.0031288    .0231149
   LibValues |   .0995435   .0057576    17.29   0.000      .088254    .1108329
       _cons |   1.905105   .0219473    86.80   0.000      1.86207    1.948139
------------------------------------------------------------------------------

. eststo
(est4 stored)

. regress LibDemScale Age BIPOC FemaleGender Graduate Income LibValues SocJusValues [pweight=weight_allpanel_20
> 20Nov], robust 
(sum of wgt is 2,836.2758)

Linear regression                               Number of obs     =      2,853
                                                F(7, 2845)        =      57.92
                                                Prob > F          =     0.0000
                                                R-squared         =     0.2311
                                                Root MSE          =     .19772

------------------------------------------------------------------------------
             |               Robust
 LibDemScale | Coefficient  std. err.      t    P>|t|     [95% conf. interval]
-------------+----------------------------------------------------------------
         Age |  -.0002514   .0078502    -0.03   0.974     -.015644    .0151411
       BIPOC |  -.0160103   .0141893    -1.13   0.259    -.0438326    .0118121
FemaleGender |  -.0898268   .0126539    -7.10   0.000    -.1146386   -.0650151
    Graduate |   .0353683   .0114596     3.09   0.002     .0128984    .0578382
      Income |    .009423   .0066206     1.42   0.155    -.0035587    .0224046
   LibValues |   .1022516   .0087252    11.72   0.000     .0851433      .11936
SocJusValues |   -.004563   .0108515    -0.42   0.674    -.0258405    .0167146
       _cons |   1.904014    .022708    83.85   0.000     1.859488     1.94854
------------------------------------------------------------------------------

. eststo
(est5 stored)

. esttab

--------------------------------------------------------------------------------------------
                      (1)             (2)             (3)             (4)             (5)   
              LibDemScale     LibDemScale     LibDemScale     LibDemScale     LibDemScale   
--------------------------------------------------------------------------------------------
SocJusValues       0.0623***       0.0744***                                     -0.00456   
                   (8.56)          (9.15)                                         (-0.42)   

Age                               0.00582                        0.000307       -0.000251   
                                   (0.68)                          (0.04)         (-0.03)   

BIPOC                             -0.0338*                        -0.0181         -0.0160   
                                  (-2.21)                         (-1.32)         (-1.13)   

FemaleGender                      -0.0694***                      -0.0899***      -0.0898***
                                  (-4.82)                         (-7.14)         (-7.10)   

Graduate                           0.0552***                       0.0354**        0.0354** 
                                   (4.35)                          (3.09)          (3.09)   

Income                             0.0217**                       0.00999         0.00942   
                                   (2.96)                          (1.49)          (1.42)   

LibValues                                          0.0907***       0.0995***        0.102***
                                                  (15.93)         (17.29)         (11.72)   

_cons               1.773***        1.869***        1.775***        1.905***        1.904***
                 (268.33)         (72.09)        (317.42)         (86.80)         (83.85)   
--------------------------------------------------------------------------------------------
N                    3256            2853            3256            2853            2853   
--------------------------------------------------------------------------------------------
t statistics in parentheses
* p<0.05, ** p<0.01, *** p<0.001

. 
. log close
      name:  <unnamed>
       log:  C:\Users\sbstjp\OneDrive - Cardiff University\FinalHarvard\Appendix8.4.log
  log type:  text
 closed on:  12 May 2025, 18:21:31
---------------------------------------------------------------------------------------------------------------
